<?php 

if (! defined('BASEPATH')) exit('No direct script access');

class sound_model extends CI_Model {

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
    
    function get_by_id($branch_id = FALSE)
    {
        if ($branch_id === FALSE)
        {
            return FALSE;
        }
        
        $query = $this->db->where('id', $branch_id)
                          ->get('sound');
        if ($query->num_rows() == 1)
        {
            return $query->row();
        }
        else
        {
            return FALSE;
        }
    }
    
    function get_all($num = FALSE, $offset = FALSE) 
    {
        $query = $this->db->select('*' )
                          ->get('sound', $num, $offset);
        return $query->result();
    }
    
    
    
    
    function create($name = FALSE, $description = FALSE, $address = FALSE)
    {
        if ($name === FALSE OR $description === FALSE OR $address === FALSE )
        {
            return FALSE;
        }

        $branch = array('name' => $name,
                         'description' => $description,
                         'address' => $address
                        );
        $this->db->insert('movie', $branch);
	    return TRUE;
        
    }
    
    function update($branch_id = FAlSE , $name = FALSE, $description = FALSE, $address = FALSE)
    {
        if ($branch_id === FALSE OR $name === FALSE OR $description === FALSE OR $address === FALSE )
        {
            return FALSE;
        }
        $branch = array('name' => $name,
                         'description' => $description,
                         'address' => $address
                        );
        $this->db->where('id', $branch_id);
        $this->db->update('branch', $branch);
        return TRUE;
    }
    
    function delete($branch_id = FALSE)
    {
        if ($branch_id === FALSE)
        {
            return FALSE;
        }
        $this->db->where('id', $branch_id);
        $this->db->delete('branch');
        return TRUE;
    }
    
   
}
/* End of file fixture_model.php */
/* Location: ./system/application/models/fixture_model.php */